package be.ac.ua.codebase;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.UUID;

import net.jini.config.ConfigurationException;
import net.jini.core.transaction.CannotJoinException;
import net.jini.core.transaction.UnknownTransactionException;
import net.jini.core.transaction.server.CrashCountException;
import net.jini.core.transaction.server.TransactionManager;

public interface BankInterface extends Remote {
	public String getName() throws RemoteException;
	public UUID register(String firstName, String familyName, int postalCode) throws RemoteException, ConfigurationException;
	public UUID register(String firstName, String familyName, String postalCode) throws RemoteException, ConfigurationException;
	public double getAmount(UUID accountId) throws RemoteException;
	public void credit(UUID accountId, double amount) throws RemoteException ;
	public void debit(UUID accountId, double amount) throws RemoteException ;
	public void credit(UUID accountId, double amount, long transactionId) throws RemoteException, UnknownTransactionException, CannotJoinException, CrashCountException;
	public void debit(UUID accountId, double amount, long transactionId) throws RemoteException, UnknownTransactionException, CannotJoinException, CrashCountException;
}
